<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@include file="../common/base.jsp"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<button type="button" class="btn btn-primary btn-xs <c:if test="${Pageutil.per==ageutil.currentPage}">disabled</c:if>" data-direction='${Pageutil.per }'>上一页</button>
<button type="button" class="btn btn-primary btn-xs <c:if test="${Pageutil.next==ageutil.currentPage}">disabled</c:if>" data-direction='${Pageutil.next }'>下一页</button>
<span>[第<b>${Pageutil.currentPage }</b>页]/</span>
<span class="mar">[共<b>${Pageutil.allPage }</b>页]</span>
<span>[每页<b>${Pageutil.maxrecord }</b>条]/</span>
<span class="mar">[共<b>${Pageutil.allResult }</b>条]</span>
<span>每页显示</span>
<input type="text" class="maxpage" name="maxrecord" placeholder="10" maxlength="2" value="${Pageutil.maxrecord }"/>
<span class="mar">条</span>
<button type="submit" class="btn btn-primary btn-xs" id="config_edit_page">确认</button>
<button type="submit" class="btn btn-primary btn-xs" id="refresh_page">刷新</button>
<button type="reset" class="btn btn-primary btn-xs" id="refresh_page">清空所有搜索条件</button>
<input type="hidden" name="currentPage" value="${Pageutil.currentPage }">
<input type="hidden" name="orderType" value="${Pageutil.orderType }">
<input type="hidden" name="sortField" value="${Pageutil.sortField }">
	<script type="text/javascript">
		$(function(){
			//排序
			
			var form_obj=$("#list_page_form");
			$("table th span[data-property]").click(function(){
				$("input[name='sortField']",form_obj).val($(this).data("property"));
				var ordertype=getCookie("ordertype");
				if(ordertype==null||ordertype=="") ordertype="asc";
				$("input[name='orderType']",form_obj).val(ordertype);
				setCookie("ordertype", ordertype=="asc"?"desc":"asc");
				form_obj.submit();
			});
			$("[data-direction]").click(function(){
				if(!$(this).hasClass("disabled")){
					$("input[name='currentPage']",form_obj).val($(this).data("direction"));
					form_obj.submit();
				}
			});
			$("#refresh_page").click(function(){
				$("input[type='text']",from_obj).ecah(function(){
					$(this).val("");
				});
			});

		});
	</script>